package edu.cmu.cs.stage3.alice.core.question.array;

import edu.cmu.cs.stage3.alice.core.Array;
import edu.cmu.cs.stage3.alice.core.property.ArrayProperty;

public abstract class ArrayObjectQuestion extends edu.cmu.cs.stage3.alice.core.Question {
	public final ArrayProperty array = new ArrayProperty( this, "array", null );
	protected abstract Object getValue( Array array );
	//Rem @Override
	public Class getValueClass() {
		return array.getArrayValue().valueClass.getClassValue();
	}
	//Rem @Override
	public Object getValue() {
		Array arrayValue = array.getArrayValue();
		if( arrayValue!=null ) {
			return getValue( arrayValue );
		} else {
			return null;
		}
	}
}